package com.bruce.apkinstaller;

import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import java.util.ArrayList;

import static org.junit.Assert.assertEquals;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals("com.htrip.apkinstaller", appContext.getPackageName());
    }

    @Test
    public void apkinstall() throws Exception {
        ArrayList<String> apklist = new ArrayList<>();
        apklist.add("/sdcard/htrip/launcherAssets/581e2aedeff23f210b4f40b1edecf4be.apk");//apk的绝对路径
        Intent intent = new Intent();
        intent.setAction(Receiver.ACTION_ASSETS_UPDATE_COMPLETED);
        intent.putStringArrayListExtra(Receiver.ACTION_APK_LIST, apklist);

    }
}
